feat: Refine behavior_binding_event, nested trans #2848
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR essentially does multiple things in one commit. These are all quite linked to one another, I wasn't quite able to untangle them from each other.
sensors.c
.zmk_behavior_binding_event
so that it is actually a zmk event, i.e. is raised and managed byevent_manager
.&trans
inside of other behaviors, getting rid ofZMK_BEHAVIOR_TRANSPARENT
in the process.Taking the explanation from #573:
We currently have the following events
What is missing from this event flow are behavior bindings. This means they can not be observed like other events.
This refactor/feat will allow for much more advanced and elegant handling in the future. My goal is to use this to rework combos a bit further. Nesting
&trans
is also a benefit that should not be underestimated, it will make things like home-row mods much easier to set up. The sensor refactor should allow further work on that part to be simpler as well.Needs documentation and lots of testing, particularly around the encoder bits as the tests we have are very rudimentary. There are likely some stylistic bits that could use tidying up as well.
Closes: #573, #532, #2368
PR check-list